package com.xhd.config;

import java.io.Serializable;
import java.math.BigDecimal;

public class XConfItem implements Serializable {
	private static final long jm51 = 1L;
	String jm21 = null;
	String jm283 = null;
	String jm284 = null;
	String jm285 = "varchar";

	public XConfItem(String paramString1, String paramString2) {
		this.jm21 = paramString1;
		if (paramString2 != null)
			this.jm283 = paramString2;
		else
			this.jm283 = "";
	}

	public XConfItem(String paramString1, String paramString2,
			String paramString3) {
		this.jm21 = paramString1;
		if (paramString2 != null)
			this.jm283 = paramString2;
		else
			this.jm283 = "";
		if (paramString3 == null)
			return;
		if (1 == paramString3.length())
			if ("1".equals(paramString3))
				paramString3 = "varchar";
			else if ("2".equals(paramString3))
				paramString3 = "int";
			else if ("3".equals(paramString3))
				paramString3 = "number";
		this.jm285 = paramString3.toLowerCase();
	}

	public boolean boolValue() {
		if (this.jm283 != null)
			return "1".equals(this.jm283);
		return false;
	}

	public double doubleValue() {
		if ((this.jm283 != null) && (this.jm283.length() > 0))
			return Double.parseDouble(this.jm283);
		return 0.0D;
	}

	public int intValue() {
		if ((this.jm283 != null) && (this.jm283.length() > 0))
			return Integer.parseInt(this.jm283);
		return 0;
	}

	public boolean isNull() {
		return ((this.jm21 == null) || (this.jm283.length() < 1));
	}

	public String name() {
		return this.jm21;
	}

	public String strValue() {
		return this.jm283;
	}

	public Object objValue() {
		if (this.jm285 == null)
			return this.jm283;
		if ("int".equals(this.jm285))
			return new Integer(this.jm283);
		if ("number".equals(this.jm285))
			return new BigDecimal(this.jm283);
		return this.jm283;
	}

	public void setValue(String paramString) {
		this.jm283 = paramString;
	}

	public String getValueDesc() {
		return this.jm284;
	}

	public void setValueDesc(String paramString) {
		this.jm284 = paramString;
	}
}
